package fgame.controller.state
{
	import fgame.controller.Controller;
	import fgame.graphic.Graphic;
	import fgame.unit.Actor3D;
	
	import flare.core.Pivot3D;
	
	import ricky.Interface.IAct;
	import ricky.game.action.Act;
	import ricky.utils.TimeServer;
	
	public class State extends Act  //implements IAct
	{
		public function State(controller:Controller=null)
		{
			_controller=controller
		}

		public function get controller():Controller
		{
			return _controller;
		}

		public function set controller(value:Controller):void
		{
			_controller = value;

		}

		override public function action(time:Number):void
		{
			if(endTime<time && endTime>0)
				this.complete();
		}
		
		override public function begin():void
		{
			_beginTime=TimeServer.now();
			endTime=-1;
		}
		
		override public function end():void
		{
			
		}

		override public function complete():void
		{
			super.complete();
		}
		
		//
		protected var endTime:Number=0
		protected var _beginTime:Number;
		private var _controller:Controller;
		
		protected var actor3D:Actor3D;

		protected var graphic:Pivot3D;
	}
}